package com.zhhtech.zhh.ui.viewmodel

/**
 * 全局viewmodel，可提供用户信息等全局信息;
 * viewmodel做全局有个问题，每次新的监听会收到以前的数据
 */
//@MainThread
//inline fun <reified VM : ViewModel> applicationViewModel() = ViewModelLazy(VM::class, { ApplicationViewModelStoreOwner.viewModelStore }, { ApplicationViewModelStoreOwner.applicationViewModelFactory })
//class ApplicationViewModel : ViewModel() {
//    private val _UserInfoLiveDate = MutableLiveData<UserInfoBean>()
//    val mUserInfoLiveDate: LiveData<UserInfoBean> = _UserInfoLiveDate
//    fun changeUserInfo(userInfoBean: UserInfoBean) {
//        _UserInfoLiveDate.value = userInfoBean
//    }
//}
//
//object ApplicationViewModelStoreOwner : ViewModelStoreOwner {
//    private val mAppViewModelStore: ViewModelStore = ViewModelStore()
//    private val mApplicationViewModelFactory = ViewModelProvider.NewInstanceFactory()
//    override fun getViewModelStore() = mAppViewModelStore
//    val applicationViewModelFactory get() = mApplicationViewModelFactory
//}
